package com.levy.contronller.javase.proxy.commonProxy;

import com.levy.contronller.javase.proxy.Hello;
import com.levy.contronller.javase.proxy.HelloImpl;

/**
 * Created by levy on 2019/6/16.
 */
public class HelloProxy implements Hello {

    private Hello hello;

    public HelloProxy() {
        hello = new HelloImpl();
    }

    @Override
    public void say(String str) {
        brefore();

        hello.say("dfdf");

        after();

    }

    private void brefore(){
        System.out.println("before");
    }

    private void after(){
        System.out.println("after");
    }

    public static void main(String[] args) {
        HelloProxy helloProxy = new HelloProxy();;
        helloProxy.say("123");
    }
}
